<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta charset="utf-8">
    <title>船舶信息编辑</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="plugins/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="css/font_eolqem241z66flxr.css" media="all" />

</head>
<body class="childrenBody" style="margin: 15px">
<blockquote class="layui-elem-quote" style="border-left: 5px solid #ffffff">
    <fieldset class="layui-elem-field">
        <legend>船舶信息修改</legend>
        <div class="layui-field-box">

            <a href="boat.html">
                <button class="layui-btn" style="background-color: #1E9FFF">返回上一级</button>
            </a>

        </div>
    </fieldset>
</blockquote>
<form class="layui-form">

    <div class="layui-form-item">
        <label class="layui-form-label">船舶编号</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input boatId" name="boatId" id="boatId"  lay-verify="required" placeholder="请输入海域编号" value="${boat.boatId }">
        </div>

        <label class="layui-form-label">船舶名称</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input boatName" name="boatName" id="boatName" lay-verify="required" placeholder="请输入海域名称" value="${boat.boatId }" >
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">事故编号</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input accidentId" name="accidentId" id="accidentId"  lay-verify="required" placeholder="请输入事故编号" value="${boat.accidentId }">
        </div>

        <label class="layui-form-label">事故名称</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input accidentName" name="accidentName" id="accidentName"  lay-verify="required" placeholder="请输入事故名称" value="${boat.accidentName }">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">生产厂家</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input factory" name="factory" id="factory"  value="${boat.factory }">
        </div>

        <label class="layui-form-label">船籍</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input boatNation"  name="boatNation" id="boatNation" placeholder="例如：中国" value="${boat.boatNation }">
        </div>

    </div>

    <div class="layui-form-item">

        <label class="layui-form-label">船长</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input boatLong" name="boatLong" id="boatLong"  placeholder="例如：33米" value="${boat.boatLong }">
        </div>

        <label class="layui-form-label">船宽</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input boatWide" name="boatWide" id="boatWide"  placeholder="例如：6米" value="${boat.boatWide }">
        </div>

        <label class="layui-form-label">吃水深度</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input deep" name="deep" id="deep"  value="${boat.deep }">
        </div>
    </div>

    <div class="layui-form-item">

        <label class="layui-form-label">船舶类型</label>
        <div class="layui-input-inline">
            <select name="boatKind" name="boatKind" id="boatKind"  value="${boat.boatKind }">
                <option value="">请选择</option>
                <option value="0">客货船</option>
                <option value="1">普通货船</option>
                <option value="2">集装箱船</option>
                <option value="3">滚装船</option>
                <option value="4">载驳船</option>
                <option value="5">散粮船</option>
                <option value="6">煤船</option>
                <option value="7">兼用船</option>
                <option value="8">特种货船</option>
                <option value="9">油船</option>
                <option value="10">液化气体船</option>
                <option value="11">液体化学品船</option>
                <option value="12">其他</option>
            </select>
        </div>


        <label class="layui-form-label">造船日期</label>
        <div class="layui-input-inline">
            <input type="text" name="date" id="date" lay-verify="date" placeholder="yyyy-mm-dd" autocomplete="off" class="layui-input"  value="${boat.date }">
        </div>


        <label class="layui-form-label">船检登记号</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input boatLogin" name="boatLogin" id="boatLogin"  placeholder="例如：1999L3100001 " value="${boat.boatLogin }">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">吨位</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input tonnage" name="tonnage" id="tonnage"  placeholder="例如：24572" value="${boat.tonnage }">
        </div>

        <label class="layui-form-label">载重吨</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input boatLoad" name="boatLoad" id="boatLoad"  placeholder="例如：7743.0" value="${boat.boatLoad }">
        </div>

        <label class="layui-form-label">船员人数</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input boatPeople" name="boatPeople" id="boatPeople"  value="${boat.boatPeople }">
        </div>
    </div>

    <!--<div class="layui-form-item">
        <label class="layui-form-label">运输货物</label>
        <div class="layui-input-block">
            <input type="checkbox" name="tuijian" class="tuijian" title="推荐">
            <input type="checkbox" name="shenhe" class="newsStatus" title="审核">
            <input type="checkbox" name="show" class="isShow" title="展示">
        </div>
    </div>-->

    <div class="layui-form-item">
        <label class="layui-form-label">备注</label>
        <div class="layui-input-block">
            <textarea placeholder="请输入船舶其他信息" class="layui-textarea" name="other" id="other"  >
             ${boat.other }
            </textarea>
        </div>

    </div>

    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit="" lay-filter="reviseBoat">确认修改</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>
<script src="js/jquery-3.2.1.min.js"></script>
<script src="layui/layui.all.js"></script>
<script src="layui/layui.js"></script>
<script>
layui.use(['form','layer','jquery','layedit','laydate'], function(){
	  var form = layui.form,
    layer = parent.layer === undefined ? layui.layer : parent.layer,
    laypage = layui.laypage,
    layedit = layui.layedit,
    laydate = layui.laydate,
    $ = layui.jquery;
	  var boatId = $("#boatId").val();
	  $.get("boatSurveryRevise2?boatId="+boatId,function(data){
		  $("#boatKind").val(data.boatKind);
		  form.render('select');
	  });
	  laydate.render({
		    elem: '#date' //指定元素
		  });
	  form.render('select');
	  form.render();
	  
	  //监听提交
    form.on('submit(reviseBoat)', function(data) {
  	  debugger;
        var index = top.layer.msg('数据提交中，请稍候',{icon: 16,time:false,shade:0.8});
        $.ajax({
        	contentType:'application/x-www-form-urlencoded; charset=UTF-8',
        	url : "boat/reviseBoat",
        	type : "post",
        	data : data.field,
        	dataType : "json"
        })
        //弹出loading
        var index = top.layer.msg('数据提交中，请稍候',{icon: 16,time:false,shade:0.8});
        setTimeout(function(){
            top.layer.close(index);
            top.layer.msg("信息修改成功！");
            layer.closeAll("iframe");
            //刷新父页面
            parent.location.reload();
        },2000);
        return false;
    })
	  
	});
</script>
</body>
</html>